package com.thirteenClassicsServer.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import com.thirteenClassics.dto.ImportCatalogDTO;
import com.thirteenClassics.dto.PictureCatalogQueryDTO;
import com.thirteenClassics.dto.PictureDTO;
import com.thirteenClassics.entity.Catalog;
import com.thirteenClassics.entity.Picture;

@Mapper
public interface PictureMapper {


    List<Catalog> selectCatalogOrdersByName(PictureCatalogQueryDTO pictureCatalogQueryDTO);

    void insert(PictureDTO pictureDTO);

    List<Picture> selectAllPictureByid(Long id);

    @Update("UPDATE picture SET entry_id = #{entryId} WHERE bookName = #{bookName} AND catalog_full = #{catalog} AND "
            + "(book_lang = #{bookLang} OR book_lang = #{bookLang2}) ")
    int updataEntryIdByBookNameAndBookLang(ImportCatalogDTO importCatalogDTO);

    List<Catalog> selectMinorityCatalogOrdersByName(PictureCatalogQueryDTO pictureCatalogQueryDTO);

    void updateEntryIdToNullBatch(List<Long> entryId);
}
